import request from '@/utils/request'

export function getTopGoods(params) {
  return request({
    url: `/api/order-service/report/skuTop/10/${params.mouthStart}/${params.datenow}`,
    method: 'GET'
  })
}
export function getOrderCount(params) {
  return request({
    url: `/api/order-service/report/orderCount?start=${params.mouthStart}+00:00:00&end=${params.datenow}+23:59:59`,
    method: 'GET'
  })
}
export function getOrderAmount(params) {
  return request({
    url: `/api/order-service/report/orderAmount?start=${params.mouthStart}+00:00:00&end=${params.datenow}+23:59:59`,
    method: 'GET'
  })
}

// 获取工单统计信息
export function allTaskMount() {
  return request({
    url: `/api/task-service/task/search`,
    method: 'GET'
  })
}
export function completeTaskMount(params) {
  return request({
    url: `/api/task-service/task/search`,
    method: 'GET',
    params: {
      status: 4
    }
  })
}
export function taskingMount(params) {
  return request({
    url: `/api/task-service/task/search`,
    method: 'GET',
    params: {
      status: 2
    }
  })
}
export function cancelTaskMount(params) {
  return request({
    url: `/api/task-service/task/search`,
    method: 'GET',
    params: {
      status: 3
    }
  })
}

// 获取销售额趋势
export function amountGoing(params) {
  return request({
    url: `/api/order-service/report/amountCollect/${params.status}/${params.start}/${params.end}`,
    method: 'GET'
  })
}
// 获取销售额趋势
export function amountArea(params) {
  return request({
    url: `/api/order-service/report/regionCollect/${params.start}/${params.end}`,
    method: 'GET'
  })
}
// 获取合作商top5
export function friendTop5() {
  return request({
    url: `/api/vm-service/node/nodeCollect`,
    method: 'GET'
  })
}
// 获取合作商数和点位数
export function partnerCount() {
  return request({
    url: `/api/user-service/partner/count`,
    method: 'GET'
  })
}
export function nodeCount() {
  return request({
    url: `/api/vm-service/node/count`,
    method: 'GET'
  })
}
// 获取异常设备
export function badDevice() {
  return request({
    url: `/api/status-service/status/top10`,
    method: 'GET'
  })
}
